package com.bjdd.jdy.ui.ready;

import com.bjdd.jdy.util.SpUtil;
import com.bjdd.jdy.util.T;

/**
 * Created by Administrator on 2017/4/14.
 */

public class ReadyPresenter extends ReadyContract.Presenter {


    @Override
    public void onStart() {

    }

    @Override
    public void getUserInfo(String token, String userId) {
        showLoadingDialog(false);
        rxManager.add(model.getUserInfo(token,userId)
        .subscribe(result -> {
            hideLoadingDialog();
            if (!result.isError()){
                SpUtil.setUser(result.getData());
                view.setUser();
            }else {
                T.show(result.getMsg());
            }
        },e -> {
            hideLoadingDialog();
            T.show("请求失败");
        }));
    }
}
